<?php

namespace App\model;

use Illuminate\Database\Eloquent\Model;

/**
 * App\model\SendNoticeUser
 *
 * @property int $id
 * @property int|null $type
 * @property string|null $role
 * @property string|null $crearted_at
 * @property \Illuminate\Support\Carbon|null $updated_at
 * @method static \Illuminate\Database\Eloquent\Builder|\App\model\SendNoticeUser newModelQuery()
 * @method static \Illuminate\Database\Eloquent\Builder|\App\model\SendNoticeUser newQuery()
 * @method static \Illuminate\Database\Eloquent\Builder|\App\model\SendNoticeUser query()
 * @method static \Illuminate\Database\Eloquent\Builder|\App\model\SendNoticeUser whereCreartedAt($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\model\SendNoticeUser whereId($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\model\SendNoticeUser whereRole($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\model\SendNoticeUser whereType($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\model\SendNoticeUser whereUpdatedAt($value)
 * @mixin \Eloquent
 * @property \Illuminate\Support\Carbon|null $created_at
 * @method static \Illuminate\Database\Eloquent\Builder|\App\model\SendNoticeUser whereCreatedAt($value)
 */
class SendNoticeUser extends Model
{
    protected $table='send_notice_user';
    public function getRoleAttribute($value)
    {
        return explode(',', $value);
    }

    public function setRoleAttribute($value)
    {
        $this->attributes['role'] = implode(',', $value);
    }
}
